# 通用的装饰器
def decorator(fn):
    def inner(*args, **kwargs):
        print("正在计算中")
        return fn(*args, **kwargs)
    return inner


@decorator
def sum_num(a, b):
    result = a + b
    return result


@decorator
def sub(a, b):
    result = a - b
    print(result)


@decorator
def mul(*args, **kwargs):
    result = 1
    # 只有元组有数据才会执行if语句
    if args:
        for value in args:
            result *= value
    # 只有字典有数据才会执行if语句
    if kwargs:
        for value in kwargs.values():
            result *= value

    if args == None and kwargs == None:
        result = 0

    return result

result = sum_num(1, 2)

print(result)

sub(3, 2)

result = mul(1, 3, 5)
print(result)


# def show():
#     print("xxx")
#     return None
#
# result = show()
# print(result)